import java.util.Comparator;

/**
 * This class compare the name of two users
 * 
 * @author Alexandre, Cristovao, Raul, Rodolpho, Tales
 * 
 */
public class NameComparator implements Comparator<UserLoggable> {

	/**
	 * Compare both names.
	 * 
	 * @param user1
	 *            - A intance of UserLoggable to be compared.
	 * @param user2
	 *            - The other instance of UserLoggable.
	 * @return The value 0 if the both users have the same name; a value less
	 *         than 0 if user1 has a name lexicographically less than user2's
	 *         name; and a value greater than 0 if the user2's name is
	 *         lexicographically greater than user1's name.
	 */
	public int compare(UserLoggable user1, UserLoggable user2) {
		return user1.getName().compareTo(user2.getName());
	}
}
